home *** CD-ROM | disk | FTP | other *** search
- property pSpr, pMinLeft, pMaxRight
- global gMusicChan
-
- on beginSprite me
- pSpr = sprite(me.spriteNum)
- pMinLeft = 78
- pMaxRight = 152
- mUpdate(me)
- end
-
- on mouseDown me
- repeat while the stillDown
- checkElapsedTime()
- pSpr.locH = min(max(pMinLeft, the mouseH), pMaxRight)
- updateStage()
- end repeat
- end
-
- on mouseUp me
- global gMuted, gJukeMuteButton
- gMuted = 0
- sendSprite(gJukeMuteButton, #mouseLeave)
- mid = pSpr.locH - pMinLeft
- percent = float(mid) / (pMaxRight - pMinLeft)
- newVolume = integer(255 * percent)
- set the volume of sound gMusicChan to fixVolume(newVolume)
- mUpdateVolumeSlider(me)
- end
-
- on mUpdate me
- pSpr.locH = pMinLeft + (the volume of sound gMusicChan / 255.0 * (pMaxRight - pMinLeft))
- end
-
- on mUpdateVolumeSlider me
- mUpdate(me)
- playBeepSound(the volume of sound gMusicChan)
- end
-